﻿Namespace Sigortali.Hastalik
	Module Functions

		Function BildirimRaporu(ByVal Process As Token, ByVal sno As String) As Recordset
			Q("select a.repsube,a.dosyano,a.hastalik,a.dosyaacik,a.histbastar as bastar,a.histsontar as bittar,a.isyerino + ' - ' + b.isyeriadi as isyeri")
			Q("from ssd..shasgenel a left join ssd..isyerigenel b on a.isyerino = b.isyerino")
			Q("where a.sno = :sno order by dosyano")
			Return Process.OpenSQL("*", sno)
		End Function

		Function IstirahatRaporu(ByVal Process As Token, ByVal sno As String) As Recordset
			Q("select repsube,dosyano,hasdurum,histbastar as bastar,histsontar as bittar,isvhode,ssdhode,ssdhodegun")
			Q("from ssd..shasrapor where sno = :sno order by dosyano,bastar")
			Return Process.OpenSQL("*", sno)
		End Function

		Function OdemeRaporu(ByVal Process As Token, ByVal sno As String) As Recordset
			Q("select repsube,dosyano,ssdhodeno,fisno,pek,pogs,ssdhodebastar as bastar,ssdhodesontar as bittar,ssdhodemik,ssdhodegun")
			Q("from ssd..shasodeme where sno = :sno order by dosyano,bastar")
			Return Process.OpenSQL("*", sno)
		End Function

		Function OdemeRaporuLefke(ByVal Process As Token, ByVal sno As String) As Recordset
			Q("select repsube,dosyano,ssdhodeno,fisno,pek,pogs,ssdhodebastar as bastar,ssdhodesontar as bittar,ssdhodemik,ssdhodegun")
			Q("from ssd..shasodemelefke where sno = :sno order by dosyano,bastar")
			Return Process.OpenSQL("*", sno)
		End Function

	End Module
End Namespace
